package cn.codergege.dp01.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.codergege.dp01.dao.DepartmentMapper;
import cn.codergege.dp01.model.Department;
import cn.codergege.dp01.service.DepartmentService;

@Service("departmentService")
public class DepartmentServiceImpl implements DepartmentService {
	private Logger log = LoggerFactory.getLogger(DepartmentServiceImpl.class);

	@Autowired
	private DepartmentMapper departmentMapper;

	@Override
	public Department getOne(int id) {
		return departmentMapper.selectByPrimaryKey(id);
	}

	@Override
	public int deleteByPrimaryKey(Integer id) throws Exception {
		return departmentMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(Department record) throws Exception {
		return departmentMapper.insert(record);
	}

	@Override
	public int insertSelective(Department record) throws Exception {
		return departmentMapper.insertSelective(record);
	}

	@Override
	public Department selectByPrimaryKey(Integer id) {
		return departmentMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(Department record) throws Exception {
		return departmentMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(Department record) throws Exception {
		return departmentMapper.updateByPrimaryKey(record);
	}

	@Override
	public List<Department> getAll() {
		return departmentMapper.getAll();
	}

}
